<%@ page language="java" contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>PeyCard Teknei</title>
<link rel="stylesheet"
	href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700|Archivo+Narrow:400,700"
	type="text/css" />
<link href="${pageContext.request.contextPath}/static/css/style.css"
	rel="stylesheet" type="text/css" media="screen" />
<script>
	function validar_formulario() {
		var newPassword = document.getElementById("newpassword");
		var repeatPassword = document.getElementById("repeatpassword");
		var passwordTag = document.getElementById("validaPasswordTag");

		if (newPassword.value.length == 0) {
			newPassword.focus();
			passwordTag.innerHTML = "<span style='color: #f00;'>Campo requerido</span>";
			return 0;
		} else {
			passwordTag.innerHTML = "";
		}
		if (newPassword.value.length > 20) {
			newPassword.focus();
			passwordTag.innerHTML = "<span style='color: #f00;'>El valor es muy grande</span>";
		} else {
			passwordTag.innerHTML = "";
		}
		if (repeatPassword.value.length == 0) {
			repeatPassword.focus();
			passwordTag.innerHTML = "<span style='color: #f00;'>Campo requerido</span>";
			return 0;
		} else {
			passwordTag.innerHTML = "";
		}
		if (repeatPassword.value.length > 20) {
			repeatPassword.focus();
			passwordTag.innerHTML = "<span style='color: #f00;'>El valor es muy grande</span>";
			return 0;
		} else {
			passwordTag.innerHTML = "";
		}
		if (!newPassword.value.equals(repeatPassword.value)) {
			newPassword.focus();
			passwordTag.innerHTML = "<span style='color: #f00;'>Las contraseñas no coinciden</span>";
			return 0;
		} else {
			passwordTag.innerHTML = "";
		}

		document.form1.submit();
	}

	function desactivar(name) {
		var boton = document.getElementById(name);
		boton.disabled = true;
		return true;
	}
</script>
</head>
<body>
	<div id="menu-wrapper">
		<div id="menu">
			<ul>

			</ul>
		</div>
	</div>
	<!-- end #menu -->
	<div id="header-wrapper">
		<div id="header">
			<div id="logo">
				<h1>
					<a href="#">PeyCard Teknei</a>
				</h1>
			</div>
		</div>
	</div>
	<div id="wrapper">
		<!-- end #header -->
		<div id="page">
			<div id="page-bgtop">
				<div id="page-bgbtm">

					<div id="content">
						<div class="post">
							<h2 class="title">
								<a href="#">Reestablece Contraseña</a>
							</h2>
							<div style="clear: both;">&nbsp;</div>
							<div class="entry">
								<form method="post" name="f" class="signin"
									onsubmit="desactivar('button')">
									<fieldset>
										<c:if test="${not empty requestScope['message']}">
											<br />
											<span id="infomessage" class="errormessage"
												style='color: #ff0000;'> <c:out
													value="${requestScope.message}" />.
											</span>
											<br />
											<br />
										</c:if>
										<table cellspacing="0">
											<tr>
												<td id="validaPasswordTag"></td>
											</tr>
											<tr>
												<th><label for="username_or_email">Usuario</label></th>
												<td><input id="username_or_email" name="username"
													type="text" /></td>
											</tr>
											<tr>
												<th><label for="password">Nueva contraseña</label></th>
												<td><input id="password" name="newpassword"
													type="password" /></td>
											</tr>
											<tr>
												<th><label for="repeatpassword">Repite nueva
														contraseña</label></th>
												<td><input id="repeatpassword" name="repeatpassword"
													type="password" /></td>
											</tr>
											<tr>
												<th></th>
												<td><input name="commit" type="submit" value="Enviar" />
												</td>
											</tr>
										</table>
									</fieldset>
								</form>
							</div>
						</div>
						<div style="clear: both;">&nbsp;</div>
					</div>
					<!-- end #content -->
					<div style="clear: both;">&nbsp;</div>
				</div>
			</div>
		</div>
		<!-- end #page -->
	</div>
	<div id="footer">
		<p>
			&copy; 2013 PeyCard.com. | Design by <a href=#>Teknei</a>.
		</p>
	</div>
	<!-- end #footer -->
</body>
</html>
